package com.bt.dmdb.model;


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import org.hibernate.annotations.Type;
import org.joda.time.LocalDateTime;
import com.bt.dmdb.json.converter.JsonDateDeserializer;
import com.bt.dmdb.json.converter.JsonDateSerializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;




@Entity
@Table(name = "customer_copy")
@SuppressWarnings("serial")
public class CustomerCopy implements java.io.Serializable {

	private Long id;
	private String nameOfEntityCustomer;
	private String tin;
	private String countryOfIssuance;
	private String countryOfIncorporation;
	private String lei;
	private String aggregateBalanceExpected;
	private String investmentIncomeAsRatioOfGrossIncome;
	private String assetsQuarterlyInvestmentIncome;
	private String incorporationDate;
	private String bankruptcyFilingDate;
	private String usOwnersShareDistribution;
	private String usOwnersShareValueInDollars;
	private String electronicAccountNumber;	
	private String passiveIncomeofEAG;
	private String grossIncomeofEAG;
	private String totalAssestsEntity;
	private String totalAssestsEag;
	private String chapter4status;
	
	private String status;
	private String fatcaStatus;
	private String auditLog;
	private String moreInfo;
	private String isInfoMissing;
	private String isDocMissing;	
	private LoginUser createdBy;

	
	
	private LocalDateTime creationDate;
	

	
	private Set<CustomerDocumentCopy> customerDocumentCopy = new HashSet<CustomerDocumentCopy>(0);
/*	private Set<CustomerQuestionCopy> customerQuestionCopy = new HashSet<CustomerQuestionCopy>(0);*/
	private Set<StocksDistributionCopy> stocksDistributionCopy = new HashSet<StocksDistributionCopy>(0);
	private Set<RegulatorsCopy> regulatorsCopy = new HashSet<RegulatorsCopy>(0);
	private Set<RestrictedDistributorCopy> restrictedDistributorCopy = new HashSet<RestrictedDistributorCopy>(0);
	private Set<MarketCopy> marketCopy = new HashSet<MarketCopy>(0);
	private Set<SourceIncomeCopy> sourceIncomeCopy = new HashSet<SourceIncomeCopy>(0);
	private Set<EagPassiveIncomeCopy> eagPassiveIncomeCopy = new HashSet<EagPassiveIncomeCopy>(0);
	private Set<MemberStatusCopy> memberStatusCopy = new HashSet<MemberStatusCopy>(0);
	private Set<LocationsCopy> locationsCopy = new HashSet<LocationsCopy>(0);
	private Set<BusinessNatureCopy> businessNatureCopy = new HashSet<BusinessNatureCopy>(0);
	private Set<ContactCopy> contactCopy = new HashSet<ContactCopy>(0);

	public CustomerCopy() {
	}


	public CustomerCopy(Long id, String nameOfEntityCustomer, String tin,
			String countryOfIssuance, String countryOfIncorporation,
			String lei, String aggregateBalanceExpected,
			String investmentIncomeAsRatioOfGrossIncome,
			String assetsQuarterlyInvestmentIncome, String incorporationDate,
			String bankruptcyFilingDate, String usOwnersShareDistribution,
			String usOwnersShareValueInDollars, String electronicAccountNumber,
			String passiveIncomeofEAG, String grossIncomeofEAG,
			String totalAssestsEntity, String totalAssestsEag,
			String chapter4status, String status, String fatcaStatus,
			String auditLog, String moreInfo, String isInfoMissing,
			String isDocMissing, LoginUser createdBy, LoginUser updatedBy,
			LocalDateTime creationDate, LocalDateTime modificationDate,
			Set<CustomerDocumentCopy> customerDocumentCopy,
			Set<StocksDistributionCopy> stocksDistributionCopy,
			Set<RegulatorsCopy> regulatorsCopy,
			Set<RestrictedDistributorCopy> restrictedDistributorCopy,
			Set<MarketCopy> marketCopy, Set<SourceIncomeCopy> sourceIncomeCopy,
			Set<EagPassiveIncomeCopy> eagPassiveIncomeCopy,
			Set<MemberStatusCopy> memberStatusCopy,
			Set<LocationsCopy> locationsCopy,
			Set<BusinessNatureCopy> businessNatureCopy) {
		super();
		this.id = id;
		this.nameOfEntityCustomer = nameOfEntityCustomer;
		this.tin = tin;
		this.countryOfIssuance = countryOfIssuance;
		this.countryOfIncorporation = countryOfIncorporation;
		this.lei = lei;
		this.aggregateBalanceExpected = aggregateBalanceExpected;
		this.investmentIncomeAsRatioOfGrossIncome = investmentIncomeAsRatioOfGrossIncome;
		this.assetsQuarterlyInvestmentIncome = assetsQuarterlyInvestmentIncome;
		this.incorporationDate = incorporationDate;
		this.bankruptcyFilingDate = bankruptcyFilingDate;
		this.usOwnersShareDistribution = usOwnersShareDistribution;
		this.usOwnersShareValueInDollars = usOwnersShareValueInDollars;
		this.electronicAccountNumber = electronicAccountNumber;
		this.passiveIncomeofEAG = passiveIncomeofEAG;
		this.grossIncomeofEAG = grossIncomeofEAG;
		this.totalAssestsEntity = totalAssestsEntity;
		this.totalAssestsEag = totalAssestsEag;
		this.chapter4status = chapter4status;
		this.status = status;
		this.fatcaStatus = fatcaStatus;
		this.auditLog = auditLog;
		this.moreInfo = moreInfo;
		this.isInfoMissing = isInfoMissing;
		this.isDocMissing = isDocMissing;
		this.createdBy = createdBy;

		this.creationDate = creationDate;
	
		this.customerDocumentCopy = customerDocumentCopy;
		this.stocksDistributionCopy = stocksDistributionCopy;
		this.regulatorsCopy = regulatorsCopy;
		this.restrictedDistributorCopy = restrictedDistributorCopy;
		this.marketCopy = marketCopy;
		this.sourceIncomeCopy = sourceIncomeCopy;
		this.eagPassiveIncomeCopy = eagPassiveIncomeCopy;
		this.memberStatusCopy = memberStatusCopy;
		this.locationsCopy = locationsCopy;
		this.businessNatureCopy = businessNatureCopy;
	}


	@Id
	@GeneratedValue(generator = "customerCopyIG", strategy = GenerationType.TABLE)
	@TableGenerator(name = "customerCopyIG", table = "jpa_sequences", pkColumnName = "name", pkColumnValue = "CustomerCopy", allocationSize = 10, valueColumnName = "next_hi_value")
	@Column(name = "id")
	// @GeneratedValue
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "name_entity_customer")
	public String getNameOfEntityCustomer() {
		return nameOfEntityCustomer;
	}

	public void setNameOfEntityCustomer(String nameOfEntityCustomer) {
		this.nameOfEntityCustomer = nameOfEntityCustomer;
	}

	@Column(name = "tin")
	public String getTin() {
		return tin;
	}

	public void setTin(String tin) {
		this.tin = tin;
	}
	
	@Column(name = "country_of_issuance")
	public String getCountryOfIssuance() {
		return countryOfIssuance;
	}

	public void setCountryOfIssuance(String countryOfIssuance) {
		this.countryOfIssuance = countryOfIssuance;
	}
	
	@Column(name = "country_of_incorporation")
	public String getCountryOfIncorporation() {
		return countryOfIncorporation;
	}

	public void setCountryOfIncorporation(String countryOfIncorporation) {
		this.countryOfIncorporation = countryOfIncorporation;
	}

	@Column(name = "lei")
	public String getLei() {
		return lei;
	}

	public void setLei(String lei) {
		this.lei = lei;
	}
	
	@Column(name = "aggregate_balance_expected")
	public String getAggregateBalanceExpected() {
		return aggregateBalanceExpected;
	}

	public void setAggregateBalanceExpected(String aggregateBalanceExpected) {
		this.aggregateBalanceExpected = aggregateBalanceExpected;
	}
	
	@Column(name = "investment_income_as_ratio_of_grossincome")
	public String getInvestmentIncomeAsRatioOfGrossIncome() {
		return investmentIncomeAsRatioOfGrossIncome;
	}

	public void setInvestmentIncomeAsRatioOfGrossIncome(
			String investmentIncomeAsRatioOfGrossIncome) {
		this.investmentIncomeAsRatioOfGrossIncome = investmentIncomeAsRatioOfGrossIncome;
	}
	
	@Column(name = "assets_pledged_Quarterly_investment_income")
	public String getAssetsQuarterlyInvestmentIncome() {
		return assetsQuarterlyInvestmentIncome;
	}

	public void setAssetsQuarterlyInvestmentIncome(
			String assetsQuarterlyInvestmentIncome) {
		this.assetsQuarterlyInvestmentIncome = assetsQuarterlyInvestmentIncome;
	}
	
	@Column(name = "incorporation_date")
	public String getIncorporationDate() {
		return incorporationDate;
	}

	public void setIncorporationDate(String incorporationDate) {
		this.incorporationDate = incorporationDate;
	}
	
	@Column(name = "bankruptcy_filing_date")
	public String getBankruptcyFilingDate() {
		return bankruptcyFilingDate;
	}

	public void setBankruptcyFilingDate(String bankruptcyFilingDate) {
		this.bankruptcyFilingDate = bankruptcyFilingDate;
	}

	@Column(name = "us_owners_share_distribution")
	public String getUsOwnersShareDistribution() {
		return usOwnersShareDistribution;
	}

	public void setUsOwnersShareDistribution(String usOwnersShareDistribution) {
		this.usOwnersShareDistribution = usOwnersShareDistribution;
	}
	
	@Column(name = "us_owers_share_value_in_dollars")
	public String getUsOwnersShareValueInDollars() {
		return usOwnersShareValueInDollars;
	}

	public void setUsOwnersShareValueInDollars(
			String usOwnersShareValueInDollars) {
		this.usOwnersShareValueInDollars = usOwnersShareValueInDollars;
	}

	
	
	@Column(name = "electronic_account_number")
	public String getElectronicAccountNumber() {
		return electronicAccountNumber;
	}

	public void setElectronicAccountNumber(String electronicAccountNumber) {
		this.electronicAccountNumber = electronicAccountNumber;
	}
	
	@Column(name = "status")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@Column(name = "audit_log")
	public String getAuditLog() {
		return auditLog;
	}

	public void setAuditLog(String auditLog) {
		this.auditLog = auditLog;
	}
	
	@Column(name = "moreinfo")
	public String getMoreInfo() {
		return moreInfo;
	}

	public void setMoreInfo(String moreInfo) {
		this.moreInfo = moreInfo;
	}
	@Column(name = "isInfoMissing")
	public String getIsInfoMissing() {
		return isInfoMissing;
	}

	public void setIsInfoMissing(String isInfoMissing) {
		this.isInfoMissing = isInfoMissing;
	}
	@Column(name = "isDocMissing")
	public String getIsDocMissing() {
		return isDocMissing;
	}

	public void setIsDocMissing(String isDocMissing) {
		this.isDocMissing = isDocMissing;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "created_by")
	public LoginUser getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(LoginUser createdBy) {
		this.createdBy = createdBy;
	}

	@Column(name = "creation_date")
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")
    @JsonSerialize(using = JsonDateSerializer.class)
    @JsonDeserialize(using = JsonDateDeserializer.class)
	public LocalDateTime getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(LocalDateTime creationDate) {
		this.creationDate = creationDate;
	}
	
	@Column(name = "passive_income_eag")
	public String getPassiveIncomeofEAG() {
		return passiveIncomeofEAG;
	}

	public void setPassiveIncomeofEAG(String passiveIncomeofEAG) {
		this.passiveIncomeofEAG = passiveIncomeofEAG;
	}
	@Column(name = "gross_income_eag")
	public String getGrossIncomeofEAG() {
		return grossIncomeofEAG;
	}

	public void setGrossIncomeofEAG(String grossIncomeofEAG) {
		this.grossIncomeofEAG = grossIncomeofEAG;
	}
	@Column(name = "total_assets_entity")
	public String getTotalAssestsEntity() {
		return totalAssestsEntity;
	}

	public void setTotalAssestsEntity(String totalAssestsEntity) {
		this.totalAssestsEntity = totalAssestsEntity;
	}
	@Column(name = "total_assets_eag")
	public String getTotalAssestsEag() {
		return totalAssestsEag;
	}

	public void setTotalAssestsEag(String totalAssestsEag) {
		this.totalAssestsEag = totalAssestsEag;
	}
	@Column(name = "fatca_status")
	public String getFatcaStatus() {
		return fatcaStatus;
	}

	public void setFatcaStatus(String fatcaStatus) {
		this.fatcaStatus = fatcaStatus;
	}
	
	@Column(name = "chapter4status")
	public String getChapter4status() {
		return chapter4status;
	}
	public void setChapter4status(String chapter4status) {
		this.chapter4status = chapter4status;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer", cascade = CascadeType.ALL)
	public Set<CustomerDocumentCopy> getCustomerDocumentCopy() {
		return customerDocumentCopy;
	}

	public void setCustomerDocumentCopy(
			Set<CustomerDocumentCopy> customerDocumentCopy) {
		this.customerDocumentCopy = customerDocumentCopy;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customerCopy", cascade = CascadeType.ALL)
	public Set<StocksDistributionCopy> getStocksDistributionCopy() {
		return stocksDistributionCopy;
	}

	public void setStocksDistributionCopy(
			Set<StocksDistributionCopy> stocksDistributionCopy) {
		this.stocksDistributionCopy = stocksDistributionCopy;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customerCopy", cascade = CascadeType.ALL)
	public Set<RegulatorsCopy> getRegulatorsCopy() {
		return regulatorsCopy;
	}

	public void setRegulatorsCopy(Set<RegulatorsCopy> regulatorsCopy) {
		this.regulatorsCopy = regulatorsCopy;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customerCopy", cascade = CascadeType.ALL)
	public Set<RestrictedDistributorCopy> getRestrictedDistributorCopy() {
		return restrictedDistributorCopy;
	}

	public void setRestrictedDistributorCopy(
			Set<RestrictedDistributorCopy> restrictedDistributorCopy) {
		this.restrictedDistributorCopy = restrictedDistributorCopy;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customerCopy", cascade = CascadeType.ALL)
	public Set<MarketCopy> getMarketCopy() {
		return marketCopy;
	}

	public void setMarketCopy(Set<MarketCopy> marketCopy) {
		this.marketCopy = marketCopy;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customerCopy", cascade = CascadeType.ALL)
	public Set<SourceIncomeCopy> getSourceIncomeCopy() {
		return sourceIncomeCopy;
	}

	public void setSourceIncomeCopy(Set<SourceIncomeCopy> sourceIncomeCopy) {
		this.sourceIncomeCopy = sourceIncomeCopy;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customerCopy", cascade = CascadeType.ALL)
	public Set<EagPassiveIncomeCopy> getEagPassiveIncomeCopy() {
		return eagPassiveIncomeCopy;
	}

	public void setEagPassiveIncomeCopy(
			Set<EagPassiveIncomeCopy> eagPassiveIncomeCopy) {
		this.eagPassiveIncomeCopy = eagPassiveIncomeCopy;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customerCopy", cascade = CascadeType.ALL)
	public Set<MemberStatusCopy> getMemberStatusCopy() {
		return memberStatusCopy;
	}

	public void setMemberStatusCopy(Set<MemberStatusCopy> memberStatusCopy) {
		this.memberStatusCopy = memberStatusCopy;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customerCopy", cascade = CascadeType.ALL)
	public Set<LocationsCopy> getLocationsCopy() {
		return locationsCopy;
	}

	public void setLocationsCopy(Set<LocationsCopy> locationsCopy) {
		this.locationsCopy = locationsCopy;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customerCopy", cascade = CascadeType.ALL)
	public Set<BusinessNatureCopy> getBusinessNatureCopy() {
		return businessNatureCopy;
	}

	public void setBusinessNatureCopy(Set<BusinessNatureCopy> businessNatureCopy) {
		this.businessNatureCopy = businessNatureCopy;
	}

	/*@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer", cascade = CascadeType.ALL)
	public Set<CustomerQuestionCopy> getCustomerQuestionCopy() {
		return customerQuestionCopy;
	}


	public void setCustomerQuestionCopy(
			Set<CustomerQuestionCopy> customerQuestionCopy) {
		this.customerQuestionCopy = customerQuestionCopy;
	}*/

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customerCopy", cascade = CascadeType.ALL)
	public Set<ContactCopy> getContactCopy() {
		return contactCopy;
	}


	public void setContactCopy(Set<ContactCopy> contactCopy) {
		this.contactCopy = contactCopy;
	}

}
